home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / doom / hxtutor.zip / HXTUTO01.ACS < prev    next >
Text File  |  1996-07-09  |  30KB  |  948 lines

  1. #include "common.acs"
  2.  
  3. int WallHits;  //Counts the number of times rock wall hits
  4. int BellRung; //Counts the number of times the bell is rung
  5. int GameStart;  //Prints the Start Message to the various classes
  6. int GemPuzzle;  //Counter for the Gem/Planets Puzzle
  7.  
  8.  
  9. script 2 (void)
  10. {
  11.     int ToGo;
  12.     ToGo = 2 - FivePortals;
  13.     ambientsound("PuzzleSuccess", 127);
  14.     print(s: "ONE FORTH OF THE PUZZLE HAS BEEN SOLVED");
  15.     delay(32);
  16.     print(s: "FIVEPORTALS IS ", d: FivePortals + 1);
  17.     delay(20);
  18.     if(FivePortals < 2)
  19.     {
  20.         print(s:"YOU STILL HAVE " , d: ToGo, s:" SWITCHES TO GO");
  21.     }
  22.     FivePortals++;
  23.     delay(24);
  24.     ACS_Execute(160, 1, 0, 0, 0);
  25. }
  26.  
  27. // SCRIPT 99 - Message Terminate Script
  28. //             Keeps Message Scripts From Overlapping
  29. // 
  30. // Kills all Message Scripts except the one that called it
  31. // Variables:
  32. //      Local:
  33. //        ScriptNum - Number of script that called this script
  34. //        Counter - To count through the message scripts
  35. // Triggering Event:
  36. //    Each script in the Message Block calls this script as the first
  37. //    thing it does, thus killing all other Message scripts and
  38. //    allowing it to print it's message
  39. //    ACS_Execute(99, 1, X, 0, 0)
  40. //      Script Number 99
  41. //      Map Number     1
  42. //      X = Number of script that called it
  43. //      0
  44. //      0 When using ACS_Execute from WITHIN a Script, you need to go ahead
  45. //        and put in all 5 parameters, even if you don't use them
  46. //        Just put 0 for all that you don't use
  47.  
  48. script 99 (int ScriptNum)
  49. {
  50.     int Counter;
  51.     Counter = 100;       // 100 = 1st Script in Message Block
  52.  
  53.     while(Counter < 114) // 114 = Last Script in Message Block + 1
  54.     {
  55.         if(ScriptNum != Counter) // Do this for all scripts except the
  56.         {                        // one who called it
  57.             ACS_Terminate(Counter, 1); // Terminate Script
  58.         }
  59.     Counter++;  // Increment Counter
  60.     }
  61. }
  62.  
  63. // BEGIN Message Block of Scripts
  64. // Most Message Statements that you will encounter will start
  65. // here at 100.  There is no reason for this other than to
  66. // keep them together, thus making them easier to find for
  67. // both you and me :)
  68. // Actually I have added a reason, Script 99 which keeps the
  69. // messages from overlapping and thus becoming unreadable
  70.  
  71. // SCRIPT 100 is the first script you will encounter in the game
  72. // It prints a message based upon which Player Class you start
  73. // with.  It then prints out some opening info.
  74. // Variables:
  75. //     World:
  76. //       none  
  77. //     Map:
  78. //        GameStart - Simply a Counter so that the script is run
  79. //                    only once, when you start the game.
  80. //     Local:
  81. //        PlayerType - Passed from the 3 lines at the start of the map.
  82. //                     The lines are North lines of the 3 sectors with
  83. //                     the Weapons in them.
  84. //                     The left line is the one the Fighter Crosses so
  85. //                     it sends a 1 as it's first argument
  86. //                     The middle line sends a 2 for Cleric and the
  87. //                     right line sends a 3 for Mage.
  88. //
  89. // Triggering Event:
  90. //     Crossing any of the 3 lines mentioned above.
  91. //     Each has ACS_EXECUTE(100,1,X)  where X = 1 to 3
  92. //
  93. // One note so as not to confuse.  PlayerType is a variable created
  94. // by me.  It is NOT a Hexen variable.  I named it this because it
  95. // makes sense.  It could be called DudesClass and work just as well.
  96.  
  97.  
  98. script 100 (int PlayerType)  // PlayerType is 1 to 3 based on which line
  99. {                            // sent it.
  100.     if(GameStart==0)         // If GameStart = 0, executes the instructions
  101.     {                        // within the brackets *HERE* to *BELOW* *HERE*
  102.     Gamestart++;             // increments GameStart to 1, because it is now
  103.                              // 1, the if(Gamestart==0) is False and this
  104.                              // section of script will not be run again
  105.     //SWITCH -- The Switch function 'reads' the Playertype variable
  106.     //          If it equals 1, the statements in case 1: are executed
  107.     //          If it equals 2, case 2: is executed, and 3 for 3
  108.     //
  109.     switch(PlayerType)
  110.         {                    
  111.             case 1:          // case PlayerType is 1
  112.                 PRINT(s:"WELCOME FIGHTER");
  113.                 delay(48);
  114.                 break;      //Each case should end in a BREAK statement
  115.                             //which halts the execution of the switch
  116.                             //function
  117.             case 2:         // case PlayerType is 2
  118.                 PRINT(s:"WELCOME CLERIC");
  119.                 delay(48);
  120.                 break;
  121.             case 3:         // case PlayerType is 3
  122.                 print(s:"WELCOME MAGE");
  123.                 delay(48);
  124.                 break;
  125.         }
  126.     delay(32);
  127.     print(s: "WELCOME TO THE HEXEN SCRIPT TUTORIAL");
  128.     ambientsound("ThunderCrash", 127); // Nice sound for the start of this
  129.     delay(75);                           // tutorial, Volume = 127 (the Max.)
  130.     print(s: "HAVE YOUR SCRIPT FILE AND TUTORIAL HANDY");
  131.     delay(75);
  132.     print(s: "YOU WILL BE INFORMED OF MOST SCRIPTS NUMBERS");
  133.     delay(75);
  134.     print(s: "YOU HAVE JUST FINISHED SCRIPT 100");
  135.     delay(72);
  136.     } //*BELOW* end of if statement
  137. }
  138.  
  139. // SCRIPT 101
  140. // It prints a message as you walk down the first hallway
  141. // and approach the first 2 rooms
  142. // Variables:
  143. //     World:
  144. //       none  
  145. //     Map:
  146. //        none
  147. //     Local:
  148. //        none
  149. //
  150. // Triggering Event:
  151. //     Crossing line near the north end of the hallway
  152. //     Each has ACS_EXECUTE(101,1)  
  153.  
  154. script 101 (void)
  155. {
  156.     ACS_Execute(99, 1, 101, 0, 0);  // Terminate All Other Message Scripts
  157.     ambientsound("PickupPiece", 127);  //Just to get you attention
  158.     switch(lineside())
  159.         {
  160.         case LINE_FRONT:
  161.             print(s: "YOU ARE NOW ENTERING THE FIRST NODE");
  162.             delay(70);
  163.             print(s: "TO THE RIGHT ARE EARTHQUAKES");
  164.             delay(70);
  165.             print(s: "AND TO THE LEFT");
  166.             delay(70);
  167.             print(s: "FUN WITH WATER");
  168.             delay(70);
  169.             break;
  170.         case LINE_BACK:
  171.             print(s: "DID YOU WANT TO GO BACK TO THE START?");
  172.             delay(70);
  173.             break;
  174.         }
  175.     print(s: "YOU HAVE JUST FINISHED SCRIPT 101");
  176. }
  177.  
  178. // SCRIPT 102
  179. // It prints a message as you enter the Earthquake Room
  180. // Variables:
  181. //     World:
  182. //       none  
  183. //     Map:
  184. //        none
  185. //     Local:
  186. //        none
  187. //
  188. // Triggering Event:
  189. //     Crossing line at the entrance of the Earthquake room
  190. //     ACS_EXECUTE(102,1)  
  191.  
  192. script 102 (void)
  193. {
  194.     ACS_Execute(99, 1, 102, 0, 0);
  195.     ambientsound("PickupPiece", 127);  //Just to get your attention
  196.     delay(32);
  197.  
  198.     switch(lineside())
  199.         {
  200.         case LINE_FRONT:
  201.             ambientsound("Earthquake", 127);  //Really get your attention
  202.             print(s: "ENTERING THE EARTHQUAKE ROOM");
  203.             delay(75);
  204.             break;
  205.         case LINE_BACK:
  206.             print(s : "LEAVING EARTHQUAKE ROOM");
  207.             delay(75);
  208.             break;
  209.         }
  210.     print(s: "YOU HAVE JUST FINISHED SCRIPT 102");
  211. }
  212.  
  213. // SCRIPT 103
  214. // Prints messages about the first earthquake
  215.  
  216. script 103 (void)
  217. {
  218.     ACS_Execute(99, 1, 103, 0, 0);
  219.     ambientsound("PickupPiece", 127);  //Just to get your attention
  220.     switch(lineside())
  221.         {
  222.         case LINE_FRONT:
  223.             print(s: "LOOK AT THE POT AND THE ICE SPIKE");
  224.             delay(75);
  225.             print(s: "THEY BOTH HAVE A TID OF 2");
  226.             delay(75);
  227.             print(s: "WHEN YOU CROSS THE ICE LINE AHEAD");
  228.             delay(75);
  229.             print(s: "YOU WILL TRIGGER THE EARTHQUAKE");
  230.             delay(75);
  231.             print(s: "THESE WILL BE THE EPICENTER");
  232.             delay(75);
  233.             print(s: "THE IMPORTANT THING IS NOT WHAT THEY ARE,");
  234.             delay(75);
  235.             print(s: "MAP SPOTS, POTS, OR ETTINS, BUT,");
  236.             delay(75);
  237.